package com.terrynoya.fight.evaluation
{
	import com.terrynoya.fight.stateMachine.triggers.ITrigger;

	public class Expression implements ITrigger
	{
		private var _node:Node;
		private var _txt:String;
		
		public function Expression(node:Node,txt:String)
		{
			this._node = node;
			this._txt = txt;
		}
		
		public function get txt():String
		{
			return _txt;
		}

		public function set txt(value:String):void
		{
			_txt = value;
		}

		public function isValid(data:Object):Boolean
		{
			var ip:ExpressionInterpretor = new ExpressionInterpretor();
			var rlt:* = ip.excute(this._node,data);
			return rlt;	
		}
		
		public function excute(data:Object):*
		{
			var ip:ExpressionInterpretor = new ExpressionInterpretor();
			var rlt:* = ip.excute(this._node,data);
			return rlt;	
		}
	}
}